package edu.vt.ece.rt.benchmark;

import edu.vt.ece.rt.QR;
import edu.vt.ece.rt.dstm.TMProxy;
import edu.vt.ece.rt.quorum.util.NodeReaper;
import edu.vt.ece.rt.util.Logger.Logger;

/*
 * BenchMark Entry Point
 * @author Sudhanshu
 */

public class Application {
	public static void main(String[] args) throws Throwable {
		
		//Creates the base cluster and initiates all the nodes
		QR.init();

		TMProxy.start();
		
		Logger.debug("Running Bench Marks...");
		
		Benchmark benchmark = (Benchmark)Class.forName("edu.vt.ece.rt.benchmark." + args[0] + ".Benchmark").newInstance();

		//Kill the nodes in base cluster
		NodeReaper.reap();

		benchmark.start();
		
		QR.close();
	}
}
